package com.yeyks.common.em.mattress;

public enum OrderInfoMattressPayTypeEnum {

    WXPAY(0, "wxpay"),
    ALIPAY(1, "alipay"),
    UNITE(2, "unite"),
    JSAPI(3, "jsapi"),
    XCX(4, "xcx"),
    GZH(5, "gzh"),
    WALLET(6, "wallet"),
    OFFLINE(10, "线下");

    int value;
    String desc;

    OrderInfoMattressPayTypeEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer value() {
        return this.value;
    }

    public String desc() {
        return this.desc;
    }

    public static String getDesc(int value) {
        OrderInfoMattressPayTypeEnum[] orderInfoMattressEnums = values();
        for (OrderInfoMattressPayTypeEnum orderInfoMattressEnum : orderInfoMattressEnums) {
            if (orderInfoMattressEnum.value() == value) {
                return orderInfoMattressEnum.desc();
            }
        }
        return null;
    }

    public static Integer getValue(String desc) {
        OrderInfoMattressPayTypeEnum[] orderInfoMattressEnums = values();
        for (OrderInfoMattressPayTypeEnum orderInfoMattressEnum : orderInfoMattressEnums) {
            if (orderInfoMattressEnum.desc().equals(desc)) {
                return orderInfoMattressEnum.value();
            }
        }
        return null;
    }

}
